Get verified and standardized addresses from free-form entries
We built our Address Autocomplete API for use in address autocomplete inputs. For example, for validating addresses in HTML forms. When users enter free-form addresses, the API returns verified and standardized addresses. The API returns address suggestions as you type. So, if you type "Munic ", the API will return "Munich, Bavaria, Germany " and more address suggestions to choose from. Use our API to autofill addresses at the street, city, postcode, and other address levels. You can also set biases and filters to make your search even more accurate.
Say you want your users to be able to search for results near a location, for example:
Choose a city to show hotels nearby or Enter a postcode to show the closest shops or transportation stops You can use the Address Autocomplete
API with type parameters (such as type=city or type=postcode) to let your users choose a location. Check our NPM Libraries that will help you add Address Autocomplete to your website or app. Here's an example of a bounding box and
coordinates that can be used to show results on a map and allow users to search for what they need:
datasource {} 4 keys
old_name: "Lutèce "
country: "France "
country_code: "fr "
region: "Metropolitan France "
state: "Ile-de-France "
city: "Paris "
lon: 2.3483915
lat: 48.8534951
formatted: "Paris, Ile-de-France, France "
address_line1: "Paris "
address_line2: "Ile-de-France, France "
category: "administrative "
You have a map and you want to use address autocomplete input to zoom the map to the selected location. In this case it’s not important to find the exact house or building. The goal is to show surroundings.
This is useful for:
The API also shows you the appropriate confidence level coefficients:
{
Anoher option is to ask your customer to show you their exact location on a map. Check out this JSFiddle for a demonstration of how to do that.
"confidence ":0.3535714285714286,
"confidence_city_level ":1,
"confidence_street_level ":0.7071428571428572,
"match_type ":"match_by_street "
}
Our API returns well-formatted addresses, including separate address components like house number, street, postcode (or zipcode), city, state, country and latitude/longitude coordinates. Here's an example of an Autocomplete API URL for the "Gabelsbergerstr 14, Regensburg " address string:
https://api.tmaps.tn/v1/geocode/autocomplete?text=Gabelsbergerstr%2014%2C%20Regensburg&format=json&apiKey=YOUR_API_KEY
Please note that the address should be URL-encoded as part of the URL.
The API returns all the locations corresponding to the address in the original query including parsed address, formatted addresses, and components:
results [] 4 items
0: {} 19 keys
country_code:"de "
housenumber:"14 b "
street:"Gabelsbergerstraße "
country:"Germany "
datasource {} 4 keys
postcode:"93047 "
state:"Bavaria "
district:"Regensburg "
city:"Regensburg "
lon:12.105486
lat:49.015503
suburb:"Kasernenviertel "
formatted:"Gabelsbergerstraße 14 b, 93047 Regensburg, Germany "
address_line1:"Gabelsbergerstraße 14 b "
address_line2:"93047 Regensburg, Germany "
category:"building "
result_type:"building "
The result object also contains place ids. You can pass the ids to Place Details API to get building geometries, contact details, website, and other information.
Our API accepts location type as a parameter, so you can create inputs for postcode, city, country, and more. Here’s an example of a postcode autocomplete URL, searching postcodes in Germany that start with "863 ":
https://api.tmaps.tn/v1/geocode/autocomplete?text=863&type=postcode&filter=countrycode:de&format=json&limit=20&apiKey=YOUR_API_KEY
The default number of returned results is 5. But you can increase the limit to get more results.
This API request found 7 postcodes starting with "863:
results [] 7 items
0: {} 19 keys
1: {} 19 keys
2: {} 19 keys
3: {} 19 keys
4: {} 19 keys
5: {} 19 keys
query :{} 1 key
tex: “863”
With @geoapify libraries, you can add an address autocomplete field to your website in just a few minutes:
Address Autocomplete API supports multiple languages, so you can show your customers address suggestions in their own language. Here’s a URL example of Address Autocomplete API with language parameter:
https://api.tmaps.tn/v1/geocode/autocomplete?text=Berlin%20central&limit=5&lang=de&apiKey=YOUR_API_KEY
You can get the user language settings, for example, from the browser language preferences:
const language = window.navigator.userLanguage || window.navigator.language;
Autocomplete API allows you to set preferred locations by view box, within a radius, or within a country. Use it to “search nearby”, “search within the visible area”, or limit your search to a specific area. Try the filters and biases for yourself in our Address Autocomplete Playground.
Autocomplete API returns a place ID that you can use with our Place Details API to get detailed information about the place, the building geometry, or boundaries. For example, here are the boundaries of the City of London:
We built the Geoapify Address Autocomplete API on open-data sources. That means you get permissive conditions - you can store and cache your address results and suggestions - and affordable prices. Our Free Tier includes up to 3000 address autocomplete requests per day (~ 90000 requests/month).
You'll need an API Key to use the API. To get one:
Our API returns address suggestions for the address provided. But you also want to have it work when a user types an address input. As they type, address suggestions come up. However, you don't always have to do it from scratch. We've created NPM libraries that will help you add the address input to your website just by adding a few lines of code. You can use these packages with or without a map library (Maplibre GL, Leaflet, OpenLayers). You can also customize the look and feel of the components with provided styles or with custom CSS.